<template>
	<view class="temp">
		<u-navbar :placeholder='true' :fixed='true' :safeAreaInsetTop='true' bgColor='#F5F5F5' title=""
			@leftClick='pageBack(1)' @rightClick="navRightClick" :autoBack="false">
			<view class="rightSlot" slot="right">
				<u-search bg-color="#f5f5f5" placeholder="输入订单编号/服务名称" v-model="keyword" :showAction="false"></u-search>
			</view>
		</u-navbar>
		<view class="orderList">
			<view class="tabCon">
				<customTabs @tabChange="handleTabChange" :isShowTop="false"/>
			</view>
			<view class="order-container">
				<view class="order-card" @tap="goto('pages/order/orderDetail')">
					<view class="order-header">
						<text class="order-number">订单编号：{{ orderData.orderNo }}</text>
						<view class="status-tag pending">
							<text>待付款</text>
						</view>
						<!-- <view class="status-tag processing">
							<text>待进行</text>
						</view>
						<view class="status-tag going">
							<text>进行中</text>
						</view>
						<view class="status-tag completed">
							<text>已完成</text>
						</view>
						<view class="status-tag refuseing">
							<text>退款中</text>
						</view> -->
					</view>
					<view class="order-content">
						<image class="service-image" src="/static/images/nav-tag-1.png" mode="aspectFill"></image>
						<view class="order-info">
							<text class="service-name">{{ orderData.serviceName }}</text>
							<view class="detail-item">
								<text class="label">上门时间：</text>
								<text class="value">{{ orderData.serviceTime }}</text>
							</view>
							<view class="detail-item">
								<text class="label">项目时间：</text>
								<text class="value">{{ orderData.duration }}</text>
							</view>
							<view class="detail-item">
								<text class="label">项目价格：</text>
								<text class="price">¥{{ orderData.price }}</text>
							</view>
						</view>
					</view>
					<view class="order-footer">
						<view class="btn cancel-btn">
							<text>取消订单</text>
						</view>
						<view class="btn cancel-btn">
							<text>删除订单</text>
						</view>
						<view class="btn cancel-btn">
							<text>申请售后</text>
						</view>
						<view class="btn cancel-btn" @tap.stop="goto('pages/order/evaluate')">
							<text>评价一下</text>
						</view>
						<view class="btn pay-btn">
							<text>去支付</text>
						</view>
						<view class="btn pay-btn" @tap.stop="goto('pages/order/orderTip')">
							<text>打赏</text>
						</view>
						<view class="btn pay-btn">
							<text>再次下单</text>
						</view>
						<view class="btn pay-btn" @tap.stop="goto('pages/order/refund')">
							<text>退款进度</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword: '',
				currentTab: 0,
				orderData: {
					orderNo: 'DSA41634646464646476',
					status: '代付款',
					serviceName: '全身理疗按摩',
					serviceTime: '2025-03-06 09:00',
					duration: '60分钟',
					price: '248.00'
				}
			}
		},
		methods: {
			navRightClick() {
			
			},
			handleTabChange(index) {
				this.currentTab = index;
			},
		}
	}
</script>

<style lang="scss" scoped>

	.rightSlot {
		width: 638rpx;
		height: 56rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 30rpx;
		color: #fff;
	}

	.temp {
		position: relative;

		.orderList {
			padding: 0 24rpx;
		}
	}

	.tabCon {
		margin-top: 28rpx;
	}

	.order-container {
		background-color: #f8f8f8;
		margin-top: 24rpx;
	}

	.order-card {
		background: #ffffff;
		border-radius: 16rpx;
		padding: 24rpx;
		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
	}

	.order-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 32rpx;
	}

	.order-number {
		font-size: 24rpx;
		color: rgba(152, 160, 166, 1);
	}

	.status-tag {
		width: 76rpx;
		height: 32rpx;
		border-radius: 4rpx;
		font-size: 20rpx;
		display: flex;
		align-items: center;
		justify-content: center;

		&.pending {
			color: #ff9900;
			border: 2rpx solid #ff9900;
		}

		&.going {
			color: $theme-color;
			border: 2rpx solid $theme-color;
		}

		&.processing {
			color: rgba(76, 212, 230, 1);
			border: 2rpx solid rgba(76, 212, 230, 1);
		}

		&.completed {
			color: rgba(152, 160, 166, 1);
			border: 2rpx solid rgba(152, 160, 166, 1);
		}

		&.refuseing {
			color: rgba(255, 85, 77, 1);
			border: 2rpx solid rgba(255, 85, 77, 1);
		}
	}

	.order-content {
		display: flex;
	}

	.service-image {
		width: 160rpx;
		height: 160rpx;
		border-radius: 12rpx;
		margin-right: 6rpx;
	}

	.order-info {
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		margin-left: 16rpx;
	}

	.service-name {
		font-size: 32rpx;
		font-weight: 600;
		color: #333333;
		margin-bottom: 8rpx;
	}

	.detail-item {
		display: flex;
		align-items: center;
		margin-bottom: 8rpx;
		font-size: 22rpx;
		color: rgba(94, 103, 110, 1);

		.label {
			color: rgba(94, 103, 110, 1);
			line-height: 28rpx;
		}

		.value {}

		.price {}
	}

	.order-footer {
		display: flex;
		justify-content: flex-end;
		flex-wrap: wrap;
		gap: 20rpx;
		padding-top: 36rpx;
	}

	.btn {
		width: 144rpx;
		height: 56rpx;
		border-radius: 40rpx;
		font-size: 24rpx;
		font-weight: 500;
		text-align: center;
		transition: all 0.3s ease;

		&:active {
			opacity: 0.8;
			transform: scale(0.98);
		}
	}

	.cancel-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		border: 2rpx solid rgba(229, 229, 229, 1);
		color: rgba(54, 68, 79, 1);
		background-color: transparent;

		&:active {
			background-color: #f5f5f5;
		}
	}

	.pay-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		border: 2rpx solid $theme-color;
		color: $theme-color;
		background-color: transparent;

		&:active {
			background-color: rgba(68, 212, 168, 0.1);
		}
	}

	::v-deep .u-search__content {
		height: 80rpx !important;
		border-radius: 16rpx !important;
		background: rgba(255, 255, 255, 0.95) !important;
	}

	::v-deep .u-search__content__input {
		background: rgba(255, 255, 255, 0.95) !important;
	}
</style>